/*
题目：斐波那锲数列
 */
public class Offer10 {
    public int fib(int n) {
        if(n <= 1){
            return n;
        }
        int mod = 1000000007;
        int num1 = 1;
        int num2 = 1;
        int i = 2;
        while(i < n){
            int temp = (num1 + num2) % mod;
            num2 = num1;
            num1 = temp;
            i++;
        }
        return num1;
    }
} 
